package com.example.mobile2121606110syc0328;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

import androidx.appcompat.app.AppCompatActivity;

public class activity_light extends AppCompatActivity {

    private ImageView ivMainLight;
    private Button btnMainLightOn;
    private Button btnMainLightOff;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_light);
        initView();
        btnMainLightOn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                ivMainLight.setImageResource(R.drawable.on);
            }
        });
        btnMainLightOff.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                ivMainLight.setImageResource(R.drawable.off);
            }
        });
    }

    private void initView() {
        ivMainLight = (ImageView) findViewById(R.id.ivMainLight);
        btnMainLightOn = (Button) findViewById(R.id.btnMainLightOn);
        btnMainLightOff = (Button) findViewById(R.id.btnMainLightOff);
    }
}